package com.sc.nft.feign;

import com.sc.nft.dto.IdRequest;
import com.sc.nft.dto.MerchantProductDTO;
import com.sc.nft.dto.MerchantProductUpdateDTO;
import com.sc.nft.sup.PageRequest;
import com.sc.nft.sup.PageResult;
import com.sc.nft.sup.Result;
import com.sc.nft.vo.MerchantProductGetByIdVO;
import com.sc.nft.vo.MerchantProductPageVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "nft-commercial", path = "/commercial/merchantProduct")
public interface MerchantProductClient {

    @PostMapping("/newGoods")
    Result newGoods(@RequestBody MerchantProductDTO merchantProductDTO);

    @PostMapping("/getGoodsById")
    Result<MerchantProductGetByIdVO> getGoodsById(@RequestBody @Validated IdRequest idRequest);

    @PostMapping("/page")
    PageResult<MerchantProductPageVO> page(@RequestBody PageRequest pageRequest);

    @PostMapping("/deleteGoodsById")
    Result deleteGoodsById(@RequestBody @Validated IdRequest idRequest);

    /**
     * 根据id修改产品信息
     *
     * @param merchantProductDTO
     * @return
     */
    @PostMapping("/updateById")
    Result updateById(@RequestBody MerchantProductUpdateDTO merchantProductDTO);

}
